//
//  WSLVideoTabVC.m
//  ShreddedBread
//
//  Created by lanou3g on 16/8/15.
//  Copyright © 2016年 云之君兮鹏. All rights reserved.
//

/*
 视频url : http://qiubai-video.qiushibaike.com/WLJE4YIGEII00UVP.mp4
 */


#import "WSLVideoTabVC.h"
#import "WSLTableViewCell.h"
#import "Url_marco.h"
#import <SVProgressHUD.h>
#import <UIImageView+WebCache.h>
#import <AVKit/AVKit.h>
#import <AVFoundation/AVFoundation.h>

@interface WSLVideoTabVC ()

//@property(strong,nonatomic) AVPlayer *player; //视频播放器
//@property(assign,nonatomic) CGFloat sumplayOperation; //播放总时长


@end

@implementation WSLVideoTabVC

- (void)viewDidLoad {
    [super viewDidLoad];

//    NSString *playString = @"http://qiubai-video.qiushibaike.com/WLJE4YIGEII00UVP.mp4";
//    NSURL *url = [NSURL URLWithString:playString];
//    
//    AVPlayerItem *item = [[AVPlayerItem alloc]initWithURL:url]; //设置播放的项目
//    self.player = [[AVPlayer alloc]initWithPlayerItem:item]; //初始化player对象
//    AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:_player]; //设置播放页面
    
    
#pragma mark ------>> 数据解析 <<------
//    [JJNetWorkRequst requestWithUrl:WSL_VIDEO_URL_BAOZOU(1) parameters:nil successResponse:^(NSDictionary *dic) {
//        NSLog(@"%@",dic);
//    } failureResponse:^(NSError *error) {
//        NSLog(@"%@",error);
//    }];
    
#pragma mark ------>> 提示框 <<------
//    [self showAlertViewControllerWithTitle:@"1" message:@"23423523532" preferredStyle:(UIAlertControllerStyleAlert) alertActionName:@"确定" alertActionOne:^{
//        NSLog(@"dsgdsgdsg");
//    } alertBackAfter:^{
//        NSLog(@"115646464");
//    }];
    
//        [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    
    return 10;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    
    return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    static NSString *cellIndentifier = @"WSLTableViewCell";
    WSLTableViewCell *cell = (WSLTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIndentifier];
    
    if (cell == nil) {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:cellIndentifier owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }
    self.tableView.rowHeight = cell.frame.size.height;
    return cell;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Table view delegate

// In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here, for example:
    // Create the next view controller.
    <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil];
    
    // Pass the selected object to the new view controller.
    
    // Push the view controller.
    [self.navigationController pushViewController:detailViewController animated:YES];
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
